package com.map.lbs;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baidu.mapapi.GeoPoint;

public class MockMessageFactory implements MessageFactory {
	private long mockMessageId = 1L;

	@Override
	public List<Message> fetchMessages(MapViewScope scope) {
		List<Message> messages = new ArrayList<Message>();
		
		Date date = new Date();
		date.setHours(21);
		date.setMinutes(23);
		
		Message message1 = new Message(new GeoPoint(scope.getTop() + 100000, scope.getLeft() + 100000), "送孟浩然之广陵", "故人西辞黄鹤楼，烟花三月下扬州。\n孤帆远影碧空尽，惟见长江天际流。");
		message1.setId(mockMessageId++);
		message1.setAuthor("1A");
		message1.setPhoto("face");
		message1.setLocationDesc("西直门");
		message1.setTime(new Date());
		
		Message message2 = new Message(new GeoPoint(scope.getBottom() + 100000, scope.getLeft() - 100000), "坑爹啊！", "我爸是李刚！");
		message2.setId(mockMessageId++);
		message2.setAuthor("2B");
		message2.setPhoto("face");
		message2.setLocationDesc("东直门");
		message2.setTime(date);
		
		
		Message message3 = new Message(new GeoPoint(scope.getBottom() - 100000, scope.getRight() - 100000), "春晓", "春眠不觉晓，处处闻啼鸟。\n夜来风雨声，花落知多少。");
		message3.setId(mockMessageId++);
		message3.setAuthor("3C");
		message3.setPhoto("face");
		message3.setLocationDesc("崇文门");
		message3.setTime(date);
		
		
		Message message4 = new Message(new GeoPoint(scope.getTop() - 100000, scope.getRight() + 100000), "山行", "远上寒山石径斜， 白云生处有人家。 \n停车坐爱枫林晚， 霜叶红于二月花。");
		message4.setId(mockMessageId++);
		message4.setAuthor("4D");
		message4.setPhoto("face");
		message4.setLocationDesc("建国门");
		message4.setTime(date);
		
		messages.add(message1);
		messages.add(message2);
		messages.add(message3);
		messages.add(message4);
		
		return messages;
	}

	@Override
	public Message get(Long id) {
		Message message = new Message(new GeoPoint((int)(39.80993*1e6), (int)(116.417428*1e6)), "山行", "远上寒山石径斜， 白云生处有人家。 \n停车坐爱枫林晚， 霜叶红于二月花。");
		message.setAuthor("4D");
		message.setPhoto("face");
		message.setLocationDesc("建国门");
		message.setTime(new Date());
		
		List<Comment> comments = new ArrayList<Comment>();
		Comment comment1 = new Comment();
		comment1.setAuthor("1A");
		comment1.setContent("啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊");
		comment1.setLocationDesc("立水桥");
		comment1.setPhoto("");
		comment1.setMessageId(id);
		comment1.setTime(new Date());
		
		Comment comment2 = new Comment();
		comment2.setAuthor("2B");
		comment2.setContent("呀呀呀呀呀呀呀呀呀呀呀呀丫丫丫");
		comment2.setLocationDesc("四惠桥");
		comment2.setPhoto("");
		comment2.setMessageId(id);
		comment2.setTime(new Date());
		
		Comment comment3 = new Comment();
		comment3.setAuthor("2B");
		comment3.setContent("嘿嘿黑恶和iehiehieheiehiehiehiehiehiehiehieh");
		comment3.setLocationDesc("四季青桥");
		comment3.setPhoto("");
		comment3.setMessageId(id);
		comment3.setTime(new Date());
		
		comments.add(comment1);
		comments.add(comment2);
		comments.add(comment3);
		
		message.setComments(comments);
		return message;
	}

}
